package com.srxz.mobilepharmacy.service;

import com.srxz.mobilepharmacy.entity.MedHouse;
import com.srxz.mobilepharmacy.repository.MedHouseRepository;
import com.srxz.mobilepharmacy.util.back.BackMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigInteger;
import java.util.List;

@Service
public class MedHouseService {
    @Autowired
    private MedHouseRepository medHouseRepository;

    public BackMessage findHousesOfAg(BigInteger aid){
        if(aid == null)
            return BackMessage.error("请选择机构");
        List<MedHouse> medHouses = medHouseRepository.findHouseByAid(aid);
        return BackMessage.success().putData("houses", medHouses);
    }
}
